/**
 * Dear programmer:
 * When I wrote this code, only god and I knew how it worked.
 * Now, only god knows it!
 *
 * @author: Pegasus  Date: 2018-11-26 Time: 23:09
 *
 * 员工做房统计
 */

import React, {Component} from 'react';
import {
  View,
  Text
} from 'react-native';
import {styles} from './EmployeeServiceEfficiencyView.Style';
import {COLOR_WHITE} from "../../../../constant/PHColors"

let data = [
  {name: 'hk', count: 3, timeout: 0, abnormal: 0},
  {name: 'hk', count: 6, timeout: 100, abnormal: 0},
  {name: 'hk', count: 2, timeout: 50, abnormal: 0},
]

export default class EmployeeServiceEfficiencyView extends Component {

  // 构造
  constructor(props) {
    super(props);
    // 初始状态
    this.state = {};
  }

  render() {
    return (
      <View style={{backgroundColor: COLOR_WHITE}}>
        {
          //  第一行标题
          <View>
            <View style={{height: 40, flexDirection: 'row', alignItems: 'center'}}>
              <View style={styles.left}/>
              <View style={styles.leftView}>
                <Text style={styles.headerText}>员工</Text>
              </View>
              <View style={styles.leftCenterView}>
                <Text style={styles.headerText}>分配/清洁量</Text>
              </View>
              <View style={styles.centerView}>
                <Text style={styles.headerText}>
                  超额
                </Text>
              </View>
              <View style={styles.rightView}>
                <Text style={styles.headerText}>
                  一次通过率
                </Text>
              </View>
            </View>
          </View>
        }

        {
          //  第二行以后
          data.map((item, index) => {
            return this._renderCell(item, index)
          })
        }
      </View>
    )
  }

  _renderCell(item, index) {
    return (
      <View key={index}>
        <View style={{height: 40, flexDirection: 'row', alignItems: 'center'}}>
          <View style={styles.left}>
            <View style={styles.img}/>
          </View>
          <View style={styles.leftView}>
            <Text style={styles.headerText}>hk</Text>
          </View>
          <View style={styles.leftCenterView}>
            <Text style={styles.headerText}>11间/1间</Text>
          </View>
          <View style={styles.centerView}>
            <Text style={styles.headerText}>
              -3分
            </Text>
          </View>
          <View style={styles.rightView}>
            <Text style={styles.headerText}>
              0%
            </Text>
          </View>
        </View>
      </View>
    )
  }
}
